package es.cazadoresmadridejos.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.directwebremoting.annotations.DataTransferObject;
import org.directwebremoting.hibernate.H3BeanConverter;


@DataTransferObject(converter=H3BeanConverter.class)
@Entity(name="City")
@Table(name="ciudad")
public class City extends BaseEntity{

	private static final long serialVersionUID = 2581931267235004489L;
	
	
	private String name;
	private Province province;
	
	@Column(nullable=false, name="nombre")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@ManyToOne(optional=false)
	@JoinColumn(name="provincia")
	public Province getProvince() {
		return province;
	}
	public void setProvince(Province province) {
		this.province = province;
	}
	
	
}
